package com.shixi.shixitraining.shixitraining.ui.tabhome.fragment;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.shixi.shixitraining.shixitraining.R;
import com.shixi.shixitraining.shixitraining.base.TabhostBaseFragment;
import com.shixi.shixitraining.shixitraining.ui.tabhome.entity.AuthenBean;

import java.util.List;

/**
 * Created by shenyan on 2018/8/15.
 */

public class TeacherIntroduceFragment extends TabhostBaseFragment {

    private AuthenBean.DataBean.TeacherBean teacherBean;

    @Override
    protected int getlayoutId() {
        return R.layout.fragment_teacher_introduce;
    }

    @Override
    protected void initPager() {
        Bundle arguments = getArguments();
        if (arguments!=null){
            AuthenBean mData = (AuthenBean) arguments.getSerializable("bean");
            AuthenBean.DataBean data = mData.getData();
            List<AuthenBean.DataBean.TeacherBean> teacher = data.getTeacher();

            for (int i=0;i<teacher.size();i++){
                teacherBean = teacher.get(i);
            }

            ImageView teacherImg = (ImageView) mContentView.findViewById(R.id.iv_teacher_img);
            TextView mCompanyTv = (TextView) mContentView.findViewById(R.id.tv_teacher_company);
            TextView mNameTv = (TextView) mContentView.findViewById(R.id.tv_teacher_name);
            TextView mContentTv = (TextView) mContentView.findViewById(R.id.tv_teacher_content);
            TextView mTitleTv = (TextView) mContentView.findViewById(R.id.tv_teacher_title);
            TextView mSchoolTv = (TextView) mContentView.findViewById(R.id.tv_teacher_school);

            Glide.with(this).load(teacherBean.getImage()).into(teacherImg);
            mNameTv.setText(teacherBean.getName());
            mCompanyTv.setText(teacherBean.getCompany());
            mTitleTv.setText(teacherBean.getTitle());
            mSchoolTv.setText(teacherBean.getSchool());
            mContentTv.setText(teacherBean.getDescribe());
        }

    }
}
